using System;
using System.Collections.Generic;
using System.Text;
using org.qsoft.rpcfx.core;
using org.qsoft.rpcfx.bean;
using org.qsoft.rpcfx.util;
using org.qsoft.rpcfx.common;

namespace org.qsoft.rpcfx.util
{
    public class InvokeUtil
    {
        const string NULL_PARAM_INFO = " Remote Process Call Framework Demo. You should pass a parameter named 'param' and its value must be the xml of a IServiceRequest object.  --Kimm King.";
        public static string invoke(string xmlrequest) 
        {

            //IServiceResponse response;
            //try
            //{
            //    if (xmlrequest == null)
            //    {
            //        response = new BaseServiceResponse();
            //        response.returnValue = NULL_PARAM_INFO;
            //        response.innerException = true;
                   
            //    }
            //    else
            //    {
            //        ObjCreator oc = new ObjCreator(xmlrequest);
            //        IServiceRequest obj = (IServiceRequest)oc.createObjTarget();
            //        QRequestInvoker invoker = new QRequestInvoker();
            //        response = invoker.invoker(obj);

            //        //IXmlCreator ix = new QXmlCreator(response);
            //        //s = ix.creatrXml();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    response = new BaseServiceResponse();
            //    response.returnValue = ex.Message;
            //    response.innerException = true;
            //}

            //ICreator ix = new QCreator(response);
            //string s = ix.creatrXml();
            //return s;

            return null;
        }
    }
}
